//
//  AIFGetAccountListManager.m
//  PywSdk
//
//  Created by Jade on 16/4/15.
//  Copyright © 2016年 zero. All rights reserved.
//

#import "AIFGetAccountListManager.h"

@implementation AIFGetAccountListManager

NSString *const GetAccountList_Passport = @"passport";
NSString *const GetAccountList_PassportToken = @"passport_token";
NSString *const GetAccountList_GameId = @"gameid";
NSString *const GetAccountList_Tid = @"tid";
NSString *const GetAccountList_Sign = @"sign";


- (instancetype)init
{
    self = [super init];
    if (self) {
        self.child = self;
        self.paramSource = self;
        self.validate = self;
    }
    return self;
}


#pragma mark - ETAPIManager
- (NSString *)methodName
{
    return URL_GETACCOUNTLISTBYPASSPORT;
}

- (ETAPIManagerRequestType)requestType
{
    return ETAPIManagerRequestTypePost;
}


- (NSString *)seriviceType
{
    return [PywAppInfo sharedAppInfo].seriviceType;
}


#pragma mark - ETAPIManagerParamSourceDelegate

- (NSDictionary *)paramsForApi:(ETApiBaseManager *)manager
{
    NSString *passport = [PywPlatformMain sharedPlatformMain].passport;
    NSString *passport_token = [PywPlatformMain sharedPlatformMain].passport_Token;
    NSString * gameid = [PywAppInfo sharedAppInfo].gameId;
    
    NSString *tid = [PywAppInfo sharedAppInfo].tid;
    NSString * apiSecret2 = [AppUtil getApiSecret2:tid apiSecret:[PywAppInfo sharedAppInfo].apisecret];
    NSString *sign = [NSString stringWithFormat:@"%@%@", passport,apiSecret2];
    sign = [PywCipherUtils md5:sign];
    
    MutableDictionary *param = [[MutableDictionary alloc] init];
    [param setObject:passport forKey:GetAccountList_Passport];
    [param setObject:passport_token forKey:GetAccountList_PassportToken];
    [param setObject:gameid forKey:GetAccountList_GameId];
    [param setObject:tid forKey:GetAccountList_Tid];
    [param setObject:sign forKey:GetAccountList_Sign];
    return param;
}

#pragma mark - ETAPIManagerValidator
- (BOOL)manager:(ETApiBaseManager *)manager isCorrectWithParamsData:(NSDictionary *)data
{
    return YES;
}

- (BOOL)manager:(ETApiBaseManager *)manager isCorrectWithCallBackData:(NSDictionary *)data
{
    return YES;
}
@end
